﻿using System;
using System.Net;
using System.Xml.Linq;

namespace ArmoryBrowser.Entities
{
    public class ProfessionsSkill
    {
        #region Fields
        private string _idField;
        private string _keyField;
        private string _maxField;
        private string _nameField;
        private string _valueField;
        #endregion
        #region Properties
        public string Id
        {
            get
            {
                return this._idField;
            }
            set
            {
                this._idField = value;
            }
        }

        public string Key
        {
            get
            {
                return this._keyField;
            }
            set
            {
                this._keyField = value;
            }
        }

        public String IconPath
        {
            get
            {
                return String.Format("http://armory.wow-europe.com/_images/icons/professions/{0}-sm.gif", Key);
            }
        }

        public string Max
        {
            get
            {
                return this._maxField;
            }
            set
            {
                this._maxField = value;
            }
        }

        public string Name
        {
            get
            {
                return this._nameField;
            }
            set
            {
                this._nameField = value;
            }
        }

        public string Value
        {
            get
            {
                return this._valueField;
            }
            set
            {
                this._valueField = value;
            }
        }
        #endregion
        #region Constructor
        public ProfessionsSkill(XElement element)
        {
            Id = element.GetAttributeValue("id");
            Key = element.GetAttributeValue("key");
            Max = element.GetAttributeValue("max");
            Name = element.GetAttributeValue("name");
            Value = element.GetAttributeValue("value");
        }
        #endregion
    }
}
